Theory of machines GATE example problem 11